package org.example.system.common.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.example.system.common.constant.BaseConstant;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 追踪日志实体
 * @author joey
 */
@ApiModel(value="追踪日志实体")
@Data
@Accessors(chain = true)
public class LogTrace implements Serializable {
    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "主键")
    @JsonSerialize(using= ToStringSerializer.class)
    protected Long id;
    @ApiModelProperty(value = "追踪id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long traceId;
    @ApiModelProperty(value = "是否成功")
    private Boolean success = true;
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "访问ip")
    private String ip;
    @ApiModelProperty(value = "访问地址")
    private String url;
    @ApiModelProperty(value = "类名")
    private String className;
    @ApiModelProperty(value = "方法名")
    private String methodName;
    @ApiModelProperty(value = "参数")
    private String paramContent;
    @ApiModelProperty(value = "返回结果")
    private String resultContent;
    @ApiModelProperty(value = "异常")
    private String exception;
    @ApiModelProperty(value = "持续时长")
    private Long duration;
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = BaseConstant.entity_date_format)
    private LocalDateTime createTime;
    @ApiModelProperty(value = "创建人Id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long createBy;
    @ApiModelProperty(value = "创建人名称")
    private String createByName;
}
